<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const user = {
        lastName: 'jack',
        firsatName: 'li',
        get fullName() {
          console.log('hello..');
          return `${this.lastName} ${this.firsatName}`;
        },
        set fullName(value) {
          const arr = value.split(' ');
          // jack.lastName
          this.lastName = arr[0];
          // jack.firsatName
          this.firsatName = arr[1];
        },
      };

      const jack = {
        // fullName:'lili sun',
        __proto__: user,
      };
      jack.fullName = 'lili sun';
      console.log(jack.fullName); //lili sun

      console.log(user, jack);
    </script>
  </body>
</html>
